﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using CCF20Model;
namespace CCF20Module
{
    /// <summary>
    /// Interaction logic for mobilemap.xaml
    /// </summary>
    public partial class MobileMap : Window
    {
        siteModel mySite;
        Vehicle myVehicle;
        public MobileMap(siteModel site,Vehicle vehicle)
        {
            mySite = site;
            myVehicle = vehicle;
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            this.wbMain.Navigate(new Uri(string.Format("http://211.137.44.51:8080/wiseLinkCrm/RDSmap.s?lat={0}&lon={1}", mySite.Latitude,mySite.Longitude), UriKind.RelativeOrAbsolute));
            this.lat.Text = mySite.Latitude;
            this.longtitude.Text = mySite.Longitude;
            this.customerName.Text = myVehicle.Customer.Name;
            this.phone.Text = myVehicle.Customer.FirstMobile;
            this.idc.Text = myVehicle.Devices.FirstOrDefault().IDCSimNumber;
        }
    }
}
